/**
 */
package fUML.Semantics.Activities.ExtraStructuredActivities.impl;

import fUML.Semantics.Actions.BasicActions.impl.ActionActivationImpl;

import fUML.Semantics.Activities.ExtraStructuredActivities.ExpansionActivationGroup;
import fUML.Semantics.Activities.ExtraStructuredActivities.ExpansionNodeActivation;
import fUML.Semantics.Activities.ExtraStructuredActivities.ExpansionRegionActivation;
import fUML.Semantics.Activities.ExtraStructuredActivities.ExtraStructuredActivitiesPackage;
import fUML.Semantics.Activities.ExtraStructuredActivities.TokenSet;

import fUML.Syntax.Activities.ExtraStructuredActivities.ExpansionNode;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Expansion Region Activation</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link fUML.Semantics.Activities.ExtraStructuredActivities.impl.ExpansionRegionActivationImpl#getInputTokens <em>Input Tokens</em>}</li>
 *   <li>{@link fUML.Semantics.Activities.ExtraStructuredActivities.impl.ExpansionRegionActivationImpl#getInputExpansionTokens <em>Input Expansion Tokens</em>}</li>
 *   <li>{@link fUML.Semantics.Activities.ExtraStructuredActivities.impl.ExpansionRegionActivationImpl#getActivationGroups <em>Activation Groups</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ExpansionRegionActivationImpl extends ActionActivationImpl implements ExpansionRegionActivation {
	/**
	 * The cached value of the '{@link #getInputTokens() <em>Input Tokens</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInputTokens()
	 * @generated
	 * @ordered
	 */
	protected EList<TokenSet> inputTokens;

	/**
	 * The cached value of the '{@link #getInputExpansionTokens() <em>Input Expansion Tokens</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getInputExpansionTokens()
	 * @generated
	 * @ordered
	 */
	protected EList<TokenSet> inputExpansionTokens;

	/**
	 * The cached value of the '{@link #getActivationGroups() <em>Activation Groups</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActivationGroups()
	 * @generated
	 * @ordered
	 */
	protected EList<ExpansionActivationGroup> activationGroups;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ExpansionRegionActivationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ExtraStructuredActivitiesPackage.Literals.EXPANSION_REGION_ACTIVATION;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<TokenSet> getInputTokens() {
		if (inputTokens == null) {
			inputTokens = new EObjectContainmentEList<TokenSet>(TokenSet.class, this, ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_TOKENS);
		}
		return inputTokens;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<TokenSet> getInputExpansionTokens() {
		if (inputExpansionTokens == null) {
			inputExpansionTokens = new EObjectContainmentEList<TokenSet>(TokenSet.class, this, ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_EXPANSION_TOKENS);
		}
		return inputExpansionTokens;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<ExpansionActivationGroup> getActivationGroups() {
		if (activationGroups == null) {
			activationGroups = new EObjectContainmentWithInverseEList<ExpansionActivationGroup>(ExpansionActivationGroup.class, this, ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS, ExtraStructuredActivitiesPackage.EXPANSION_ACTIVATION_GROUP__REGION_ACTIVATION);
		}
		return activationGroups;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void doStructuredActivity() {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void runGroup(ExpansionActivationGroup activationGroup) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ExpansionNodeActivation getExpansionNodeActivation(ExpansionNode node) {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int numberOfValues() {
		// TODO: implement this method
		// Ensure that you remove @generated or mark it @generated NOT
		throw new UnsupportedOperationException();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS:
				return ((InternalEList<InternalEObject>)(InternalEList<?>)getActivationGroups()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_TOKENS:
				return ((InternalEList<?>)getInputTokens()).basicRemove(otherEnd, msgs);
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_EXPANSION_TOKENS:
				return ((InternalEList<?>)getInputExpansionTokens()).basicRemove(otherEnd, msgs);
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS:
				return ((InternalEList<?>)getActivationGroups()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_TOKENS:
				return getInputTokens();
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_EXPANSION_TOKENS:
				return getInputExpansionTokens();
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS:
				return getActivationGroups();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_TOKENS:
				getInputTokens().clear();
				getInputTokens().addAll((Collection<? extends TokenSet>)newValue);
				return;
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_EXPANSION_TOKENS:
				getInputExpansionTokens().clear();
				getInputExpansionTokens().addAll((Collection<? extends TokenSet>)newValue);
				return;
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS:
				getActivationGroups().clear();
				getActivationGroups().addAll((Collection<? extends ExpansionActivationGroup>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_TOKENS:
				getInputTokens().clear();
				return;
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_EXPANSION_TOKENS:
				getInputExpansionTokens().clear();
				return;
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS:
				getActivationGroups().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_TOKENS:
				return inputTokens != null && !inputTokens.isEmpty();
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__INPUT_EXPANSION_TOKENS:
				return inputExpansionTokens != null && !inputExpansionTokens.isEmpty();
			case ExtraStructuredActivitiesPackage.EXPANSION_REGION_ACTIVATION__ACTIVATION_GROUPS:
				return activationGroups != null && !activationGroups.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //ExpansionRegionActivationImpl
